package com.hongning.railway.ui.main.fragments.cadremanagement;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hongning.railway.BR;
import com.hongning.railway.R;
import com.hongning.railway.databinding.FragmentCadremanagentBinding;
import com.hongning.railway.databinding.FragmentCollegeBinding;
import com.hongning.railway.ui.adapter.BaseFragmentPagerAdapter;
import com.hongning.railway.ui.main.fragments.college.CollegeExamFrament;
import com.hongning.railway.ui.main.fragments.college.CollegeFragment;
import com.hongning.railway.ui.main.fragments.college.CollegeLearnFragment;
import com.hongning.railway.ui.main.fragments.college.CollegeViewModel;

import java.util.ArrayList;
import java.util.Arrays;

import me.goldze.mvvmhabit.base.BaseFragment;

public class CadreManagementFragment  extends BaseFragment<FragmentCadremanagentBinding, CadreManagentViewModel> {


    public static CollegeFragment newInstance() {
        return new CollegeFragment();
    }

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_cadremanagent;
    }

    @Override
    public int initVariableId() {
        return BR.cadremanagentViewModel;
    }

    @Override
    public void initData() {
        super.initData();
        initViewPager();
    }

    private void initViewPager() {
        ArrayList<Fragment> fragments=new ArrayList<>();
        String[] title={"花名册","干部考核"};
        fragments.add(CadreManagementRosterListFragment.newInstance());
        fragments.add(CadreAssessmentFragment.newInstance());
        BaseFragmentPagerAdapter pagerAdapter = new BaseFragmentPagerAdapter(getChildFragmentManager(), fragments, Arrays.asList(title));
        binding.vpContent.setAdapter(pagerAdapter);
        binding.stlTitle.setViewPager(binding.vpContent,title);
    }
}
